<template>
  <div>
    <!-- 热门建议城市 -->
    <div class="hotsuggest">
      <div
        class="hotitem"
        v-for="(value, key, index) in hotsuggests.data"
        :key="index"
        :style="{
          color: value.tagText.color,
          background: value.tagText.background.color,
        }"
      >
        {{ value.tagText.text }}
      </div>
    </div>

    <!-- 搜索栏 -->
    <div class="searchBar">
        <div class="bar" @click="barClick">开始搜索</div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
import useHomeStore from "../../../stores/modules/homeStore";

//将父组件给的数据拿到
const props = defineProps({
  hotsuggests: {
    type: Object,
    require: true,
  },
});


//点击路由跳转
const router = useRouter();
function barClick()
{
    router.push(
        {
            path: '/search',
            querry: {
                
            }
        }
    );
}
 
</script>

<style lang="less" scoped>
.hotsuggest {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  margin-top: 20px;
  .hotitem {
    border: 1px solid #333;
    margin: 5px;
    border-radius: 10px;
    height: 10px;
    line-height: 10px;
    padding: 3px;
  }
}

.searchBar {
    
     display: flex;
     justify-content: center;
     margin-top: 10px;
     .bar
     {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 90%;
        color: #fff;
        background-color: #ff9854;
        height: 40px;
        border-radius: 30px;
        cursor: pointer;
     }
}
</style>